package com.wdj.comsumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.wdj.dubboapi.entity.UserDO;
import com.wdj.dubboapi.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class HelloController {
    @Reference
    UserService userService;
    @GetMapping("/findById/{id}")
    public UserDO findById(@PathVariable Long id){
        return userService.findById(id);
    }
    @GetMapping("/listUser")
    public List<UserDO> listUser(){
        return userService.listUser();
    }

}
